<template>
    <div class="typescript">
        <a-card :loading="loading" title="数组" class="card">
            {{arr1}}
            <br>
            {{arr2}}
            <br>
            {{arr3}}
        </a-card>
    </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue';

// 数组
let arr1: string[] = ['1', '2']

let arr2: (number | string)[]
// 表示定义了一个名称叫做arr的数组, 
// 这个数组中将来既可以存储数值类型的数据, 也可以存储字符串类型的数据
arr2 = [1, 'b', 2, 'c']

interface Arrobj{
    name: string,
    age: number
}

let arr3: Arrobj[] = [{name:'jimmy', age:22}]

</script>

<style lang="scss" scoped>
.card{
    display: inline-block;
    width: 300px;
    margin: 10px;
}
</style>